<%@ LANGUAGE="VBSCRIPT" %>
<% option explicit%>
<% Response.Expires=0 %>
<%
dim aa, bb
'aa=Request.ServerVariables("LOGON_USER")
'bb=Request.Querystring("AN")
'if instr(1,aa, bb,1)=0 THEN
'response.clear
'response.end
'end if

'aa=Request.ServerVariables("HTTP_USER_AGENT")
'bb="Indy"
'if instr(1,aa, bb,1)=0 THEN
'response.clear
'response.end
'end if

if request("Ver")="6.8.3.273" THEN
response.clear
response.end
end if


%>
<!--METADATA NAME="Microsoft ActiveX Data Objects 2.5 Library" TYPE="TypeLib" UUID="{00000205-0000-0010-8000-00AA006D2EA4}"-->
<%
dim Node,  S, DTA, RegN, Ph, Ver
Node=request("Node")
if isEmpty(Node) then Node="_P"
S=request("S")
if isEmpty(S) then S=""
DTA=request("DTA")
if isEmpty(DTA) then DTA=""
RegN=request("RegNumber")
if isEmpty(RegN) then RegN="0"
Ver=request("Ver")
if isEmpty(Ver) then Ver=""

	Dim cnn
	Dim connStr
	dim cmd
	dim R
	Set cnn=Server.CreateObject("ADODB.Connection")
    Set cmd=Server.CreateObject("ADODB.Command")
%>
<!-- #INCLUDE FILE="Connection.inc" -->
<%
''''	connStr="Provider=SQLOLEDB.1;Persist Security Info=True;User ID=Test;Password=Test;Initial Catalog=SMS"&Node&";Data Source=EM-HOME"
	cnn.open connStr
	Set cmd.ActiveConnection = cnn
	cmd.CommandType=adCmdStoredProc
	cmd.CommandText = "sp_AutomatRegistration"
	Cmd.Parameters.Append Cmd.CreateParameter("@S", adVarChar, adParamInput,1024)
	Cmd.Parameters.Append Cmd.CreateParameter("@DTA", adVarChar, adParamInput,20)
	Cmd.Parameters.Append Cmd.CreateParameter("@RegN", advarchar, adParamInput,8)
	Cmd.Parameters.Append Cmd.CreateParameter("@Ver", advarchar, adParamInput,16)
	Cmd.Parameters.Append Cmd.CreateParameter("@id", adInteger, adParamOutput)
	Cmd.Parameters.Append Cmd.CreateParameter("@Res", adInteger, adParamOutput)
	Cmd.Parameters.Append Cmd.CreateParameter("@Result", adVarChar, adParamOutput,160)
	Cmd("@S")=S
	Cmd("@DTA")=DTA
	Cmd("@RegN")=RegN
	Cmd("@Ver")=Ver
	cmd.execute
	%>
<%=Cmd("@Result")&": "&Cmd("@Res")%>
<%
	set cmd=nothing
	cnn.close
	set cnn=nothing
%>
